< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03020401.xhp

(section: chdir) (bookmark: bm_id3150178)
ChDir statement

ChDir 文

ChDir Statement [Runtime]
ChDir ステートメント [実行時](hd_id3150178.1)

Changes the current directory or drive.
現在のディレクトリないしドライブを変更します。(par_id3153126.2)

(/section: chdir) (section: i30692)
Warning Icon 警告マーク This runtime statement currently does not work as documented. See this issue for more information.
この実行時ステートメントは、現在、ドキュメントどおりに機能しません。詳細は、この課題の説明 を参照してください。(par_id9783013.)

(/section: i30692)

Syntax:
構文:(hd_id3154347.3)

ChDir Text As String
ChDir Text As String(par_id3153897.4)

Parameters:
パラメータ:(hd_id3148664.5)

Text: Any string expression that specifies the directory path or drive.
Text:ディレクトリパスないしドライブを指定する文字列表式。(par_id3150543.6)

Note Icon 注マーク If you only want to change the current drive, enter the drive letter followed by a colon.
現在のドライブのみを変更するには、ドライブレターに続けてコロンを指定します。(par_id3152598.7)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

(embed text/sbasic/shared/00000003.xhp#err76 : linkinfo)

76 Path not found
76 パスが見つかりません (par_id3150477.75)

(/embed text/sbasic/shared/00000003.xhp#err76)

Example:
例:(hd_id3151116.8)

Sub ExampleChDir
Sub ExampleChDir(par_id3153364.9)

Dim sDir1 as String , sDir2 as String
Dim sDir1 as String , sDir2 as String(par_id3147348.10)

sDir1 = "c:\Test"
sDir1 = "c:\Test"(par_id3155308.11)

sDir2 = "d:\private"
sDir2 = "d:\private"(par_id3154319.12)

ChDir( sDir1 )
ChDir( sDir1 )(par_id3154944.13)

msgbox CurDir
msgbox CurDir(par_id3151074.14)

ChDir( sDir2 )
ChDir( sDir2 )(par_id3147124.15)

msgbox CurDir
msgbox CurDir(par_id3148456.16)

end sub
end sub(par_id3149581.17)


< Prev / Next >